<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>

<input type="hidden" id="if_have_org" name="proposal/if_have_org">
<div class="t_bar"><span class="color_red">*</span>基本信息</div>
    <table class="t_css" width="100%" id="basic_info_jzfp" border="0" cellpadding="0"
        cellspacing="1">
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <col style="width: 20%"/>
    <col style="width: 30%"/>
   <%-- <col style="width: 20%"/>--%>
        <tr class="li_1">
            <td align="right">智库名称：</td>
            <td >
                <input type='text' name='proposal/zh_title' id='zh_title' style="width: 88%" class="input_css required maxlength:100" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="智库名称">
            </td>
            <td align="right">智库类型：</td>
            <td colspan="1">
                <c:set var="zk_type_value"><x:out
                        select="$xmlData/data/proposal/zk_type_value"/></c:set>
                <cpt:checkbox key="zk_type" name="zk_type" width="70px" repeatColumn="2"
                              value="${zk_type_value }" tagType="radio"></cpt:checkbox>
                <input type="hidden" id="zk_type_value"
                       name="proposal/zk_type_value" class="required"
                       value="${zk_type_value}" label="智库类型">
                <input type="hidden" name="proposal/zk_type_name"
                       value="<x:out select="$xmlData/data/proposal/zk_type_name" />">
            </td>
        </tr>

        <tr class="li_1">
            <td align="right">依托单位：</td>
            <td >
                <span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></span>            </td>
            </td>
            <td align="right">单位地址：</td>
            <td colspan="1">
                <span name="organizations/organization/address"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" /></span>
            </td>
        </tr>

        <tr >

            <td align="right">归口管理部门：</td>
            <td >
                <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
                <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理部门"
                    id="recomend_org"  showPattern="all" shieldPattern="0" topCheckbox="false" onClick="initTreeValueExt" />
                <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
                <input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
            </td>
            <td  align="right" >申报日期：</td>
            <td>
                <c:set var="submit_date">
                    <x:out select="$xmlData/data/proposal/submit_date" />
                </c:set>
                <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
            </td>
        </tr>
        <tr>
            <td align="right"> 智库具体地址：</td>
            <td colspan="3" ><input name="proposal/site_address"
                                    style="width: 80%" label="智库具体地址" type="text"
                                    class="input_css required maxlength:100" maxlength="100"
                                    value="<x:out select="$xmlData/data/proposal/site_address" />" /></td>
        </tr>
    </table>
        <table class="t_css" width="100%" id="basic_info_jzfp1" border="0" cellpadding="0"
               cellspacing="1">
            <col style="width: 20%"/>
            <col style="width: 20%"/>
            <col style="width: 20%"/>
            <col style="width: 20%"/>
            <col style="width: 20%"/>
        <tr>
            <td align="right" rowspan="2">智库负责人：</td>
            <td align="right">姓名：</td>
            <td>
                <span name="proposal/fzr_psnname"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
            </td>
            <td align="right">电话：</td>
            <td>
            <span name="proposal/fzr_tel_work"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
            </td>
        </tr>

        <tr>
            <td align="right">手机：</td>
            <td>
                <span name="proposal/fzr_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
            </td>
            <td  align="right">邮箱：</td>
            <td  >
                <span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
            </td>
        </tr>
        
        <tr>
            <td align="right" rowspan="2">联系人：</td>
            <td align="right">姓名：</td>
            <td>
                <input  type="text" label="联系人-->姓名" name="proposal/contact_psn_cname" class="input_css required" maxlength="30" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
                
            </td>
            <td align="right">手机：</td>
            <td>
                <input type="text" label="联系人-->手机" name="proposal/contact_psn_mobile" class="input_css required mobile" onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
            </td>
        </tr>

        <tr>
            <td align="right">电话：</td>
            <td style="word-break: break-all;">
                <input name="proposal/contact_psn_tel_work" label="联系人-->电话" type="text"  maxlength="50"  class="input_css required "  value="<x:out select="$xmlData/data/proposal/contact_psn_tel_work" />"/>
            </td>
            <td align="right">电子邮箱：</td>
            <td>
                <input name="proposal/contact_psn_email" label="联系人-->电子邮箱" type="text"  maxlength="50"  class="input_css required email"  value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/>
            </td>
        </tr>
    </table>

<script type="text/javascript">
$(function(){
    getLen();
});

function initTreeValueExt(treeId, treeNode) {
    if ((treeNode && treeNode.isParent)) {
        scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
        $("#" + treeId).val("");
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
        return false;
    }
    var str = treeNode.name;
    var obj = treeNode.parentNode;
    while (obj != null) {
        str = obj.name + "-" + str;
        obj = obj.parentNode;
    }
    
    $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
    $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
    $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
 }
 
 function getLen() {
    var len=$("#tblorg_hzs tr:gt(1)").length;
    if(len>0){
        $("#if_have_org").val("1");
    }else{
        $("#if_have_org").val("0");
    }
}
</script>       
